package com.bawei.lizhiyu1228.foot;

import com.bawei.lizhiyu1228.foot.Api;
import com.bawei.lizhiyu1228.foot.Foot;
import com.bawei.lizhiyu1228.foot.MyContract;
import com.bawei.lizhiyu1228.mvp.MyManager;
import com.bawei.lizhiyu1228.mvp.m.BaseModel;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * @author : zhiyu
 * @date : 2021/12/28
 * @content :
 */
public class FootModel extends BaseModel implements MyContract.FoodModel{

    @Override
    public void foodModel(Observer<Foot> observer) {
        MyManager.getInstance().getRetrofit()
                .create(Api.class)
                .getfood()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }
}
